import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/css/basic.css'
import './assets/fonts/font.css'
import req from './utils/requestType'
import Utils from './utils/util'
import * as filters from './utils/filter'
import components from './components/'; // 加载公共组件
import { Pagination,  Tooltip ,Switch } from 'element-ui';



Vue.config.productionTip = false // 阻止启动生产消息
router.beforeEach((to, from, next) => {
  next()
})


// 公共组件首字母大写
Object.keys(components).forEach((key) => {
  var name = key.replace(/(\w)/, (v) => v.toUpperCase())
  Vue.component(`ep${name}`, components[key])
});
Vue.prototype.$http = req;
Vue.prototype.util = Utils;
Vue.use(Pagination)
Vue.use(Tooltip)
Vue.use(Switch)

//vue过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
});
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')